package com.zw.design.pattern.creational.behavioral.templatemetod;

public abstract class ACourse {

    protected final void makeCourse(){

        this.makePPT();
        this.makeVideo();
        //钩子方法判断
        if (this.needWriteArticle()){
            this.writeArticle();
        }
        this.packageCourse();
    }

    final void makePPT(){
        System.out.println("编写ppt");
    }

    final void makeVideo(){
        System.out.println("编写视频");
    }

    final void writeArticle(){
        System.out.println("编写手记");
    }
    //钩子方法
    protected boolean needWriteArticle(){
        return false;
    }

    abstract  void packageCourse();
}
